﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Argos.Workflows
{
	/// <summary>
	/// The interface that must be implemented by any workflow that is used to monitor
	/// a target for changes.
	/// </summary>
	public interface ITargetChangeMonitoringWorkflow : ITargetMonitoringWorkflow
	{

		/// <summary>
		/// When implemented in a class, sets or returns the current or new state of the target.
		/// </summary>
		object CurrentTestState { get; set; }

		/// <summary>
		/// When implemented in a class, sets or returns the previous or old state of the target.
		/// </summary>
		object PreviousTestState { get; set; }



		/// <summary>
		/// When implemented in a class, handles the change of a monitored target.
		/// </summary>
		/// <param name="currentState">The current or new state of the target.</param>
		/// <param name="previousState">The previous or old state of the target.</param>
		void HandleChange(object currentState, object previousState);

		/// <summary>
		/// When implemented in a class, determines whether the state in a target has changed.
		/// </summary>
		/// <param name="currentState">The current state to compare to the previous.</param>
		/// <param name="previousState">The previous state to compare to the current.</param>
		/// <returns>Returns <c>true</c> if the two given stated are not equal.</returns>
		bool IsChanged(object currentState, object previousState);

	}
}
